package com.smbms.service.impl;

import com.smbms.dao.RoleMapper;
import com.smbms.pojo.Role;
import com.smbms.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service("RoleService")
public class RoleServiceImpl implements RoleService {

    @Autowired
    RoleMapper roleMapper;

    @Override
    public List<Role> getRoleList() {
        List<Role> roleList = new ArrayList<>();
        try {
            roleList = roleMapper.selectList(null);
        } catch (RuntimeException e){
            e.printStackTrace();
            throw e;
        }
        return roleList;
    }
}
